﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;

namespace NewsExtractor
{
    public class Utility
    {
        static string[] forbiddenFileNameCharacters = new string[] { "|", @"\", "/", ":", "*", "?", "\"", "<", ">" };
        public static string CleanURL(string url)
        {
            url = HttpUtility.UrlDecode(url);
            url = url.Replace(@"http://", string.Empty); 
            foreach (string curChar in forbiddenFileNameCharacters)
            {
                url = url.Replace(curChar, "-");
            }
            
            return url;
        }
    }
}
